\(\int \frac {1}{\sqrt {f+g x} \sqrt {a+b x+c x^2}} \, dx\) [912]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 24, antiderivative size = 189 \[ \int \frac {1}{\sqrt {f+g x} \sqrt {a+b x+c x^2}} \, dx=\frac {2 \sqrt {2} \sqrt {b^2-4 a c} \sqrt {\frac {c (f+g x)}{2 c f-\left (b+\sqrt {b^2-4 a c}\right ) g}} \sqrt {-\frac {c \left (a+b x+c x^2\right )}{b^2-4 a c}} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {\frac {b+\sqrt {b^2-4 a c}+2 c x}{\sqrt {b^2-4 a c}}}}{\sqrt {2}}\right ),-\frac {2 \sqrt {b^2-4 a c} g}{2 c f-\left (b+\sqrt {b^2-4 a c}\right ) g}\right )}{c \sqrt {f+g x} \sqrt {a+b x+c x^2}} \]

[Out]

2*EllipticF(1/2*((b+2*c*x+(-4*a*c+b^2)^(1/2))/(-4*a*c+b^2)^(1/2))^(1/2)*2^(1/2),(-2*g*(-4*a*c+b^2)^(1/2)/(2*c*
f-g*(b+(-4*a*c+b^2)^(1/2))))^(1/2))*2^(1/2)*(-4*a*c+b^2)^(1/2)*(-c*(c*x^2+b*x+a)/(-4*a*c+b^2))^(1/2)*(c*(g*x+f
)/(2*c*f-g*(b+(-4*a*c+b^2)^(1/2))))^(1/2)/c/(g*x+f)^(1/2)/(c*x^2+b*x+a)^(1/2)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 189, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {732, 430} \[ \int \frac {1}{\sqrt {f+g x} \sqrt {a+b x+c x^2}} \, dx=\frac {2 \sqrt {2} \sqrt {b^2-4 a c} \sqrt {-\frac {c \left (a+b x+c x^2\right )}{b^2-4 a c}} \sqrt {\frac {c (f+g x)}{2 c f-g \left (\sqrt {b^2-4 a c}+b\right )}} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {\frac {b+2 c x+\sqrt {b^2-4 a c}}{\sqrt {b^2-4 a c}}}}{\sqrt {2}}\right ),-\frac {2 \sqrt {b^2-4 a c} g}{2 c f-\left (b+\sqrt {b^2-4 a c}\right ) g}\right )}{c \sqrt {f+g x} \sqrt {a+b x+c x^2}} \]

[In]

Int[1/(Sqrt[f + g*x]*Sqrt[a + b*x + c*x^2]),x]

[Out]

(2*Sqrt[2]*Sqrt[b^2 - 4*a*c]*Sqrt[(c*(f + g*x))/(2*c*f - (b + Sqrt[b^2 - 4*a*c])*g)]*Sqrt[-((c*(a + b*x + c*x^
2))/(b^2 - 4*a*c))]*EllipticF[ArcSin[Sqrt[(b + Sqrt[b^2 - 4*a*c] + 2*c*x)/Sqrt[b^2 - 4*a*c]]/Sqrt[2]], (-2*Sqr
t[b^2 - 4*a*c]*g)/(2*c*f - (b + Sqrt[b^2 - 4*a*c])*g)])/(c*Sqrt[f + g*x]*Sqrt[a + b*x + c*x^2])

Rule 430

Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*Sqrt[(c_) + (d_.)*(x_)^2]), x_Symbol] :> Simp[(1/(Sqrt[a]*Sqrt[c]*Rt[-d/c, 2]
))*EllipticF[ArcSin[Rt[-d/c, 2]*x], b*(c/(a*d))], x] /; FreeQ[{a, b, c, d}, x] && NegQ[d/c] && GtQ[c, 0] && Gt
Q[a, 0] &&  !(NegQ[b/a] && SimplerSqrtQ[-b/a, -d/c])

Rule 732

Int[((d_.) + (e_.)*(x_))^(m_)/Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2*Rt[b^2 - 4*a*c, 2]*
(d + e*x)^m*(Sqrt[(-c)*((a + b*x + c*x^2)/(b^2 - 4*a*c))]/(c*Sqrt[a + b*x + c*x^2]*(2*c*((d + e*x)/(2*c*d - b*
e - e*Rt[b^2 - 4*a*c, 2])))^m)), Subst[Int[(1 + 2*e*Rt[b^2 - 4*a*c, 2]*(x^2/(2*c*d - b*e - e*Rt[b^2 - 4*a*c, 2
])))^m/Sqrt[1 - x^2], x], x, Sqrt[(b + Rt[b^2 - 4*a*c, 2] + 2*c*x)/(2*Rt[b^2 - 4*a*c, 2])]], x] /; FreeQ[{a, b
, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && EqQ[m^2, 1/4]

Rubi steps \begin{align*} \text {integral}& = \frac {\left (2 \sqrt {2} \sqrt {b^2-4 a c} \sqrt {\frac {c (f+g x)}{2 c f-b g-\sqrt {b^2-4 a c} g}} \sqrt {-\frac {c \left (a+b x+c x^2\right )}{b^2-4 a c}}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x^2} \sqrt {1+\frac {2 \sqrt {b^2-4 a c} g x^2}{2 c f-b g-\sqrt {b^2-4 a c} g}}} \, dx,x,\frac {\sqrt {\frac {b+\sqrt {b^2-4 a c}+2 c x}{\sqrt {b^2-4 a c}}}}{\sqrt {2}}\right )}{c \sqrt {f+g x} \sqrt {a+b x+c x^2}} \\ & = \frac {2 \sqrt {2} \sqrt {b^2-4 a c} \sqrt {\frac {c (f+g x)}{2 c f-\left (b+\sqrt {b^2-4 a c}\right ) g}} \sqrt {-\frac {c \left (a+b x+c x^2\right )}{b^2-4 a c}} F\left (\sin ^{-1}\left (\frac {\sqrt {\frac {b+\sqrt {b^2-4 a c}+2 c x}{\sqrt {b^2-4 a c}}}}{\sqrt {2}}\right )|-\frac {2 \sqrt {b^2-4 a c} g}{2 c f-\left (b+\sqrt {b^2-4 a c}\right ) g}\right )}{c \sqrt {f+g x} \sqrt {a+b x+c x^2}} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 22.45 (sec) , antiderivative size = 308, normalized size of antiderivative = 1.63 \[ \int \frac {1}{\sqrt {f+g x} \sqrt {a+b x+c x^2}} \, dx=\frac {i (f+g x) \sqrt {2-\frac {4 \left (c f^2+g (-b f+a g)\right )}{\left (2 c f-b g+\sqrt {\left (b^2-4 a c\right ) g^2}\right ) (f+g x)}} \sqrt {1+\frac {2 \left (c f^2+g (-b f+a g)\right )}{\left (-2 c f+b g+\sqrt {\left (b^2-4 a c\right ) g^2}\right ) (f+g x)}} \operatorname {EllipticF}\left (i \text {arcsinh}\left (\frac {\sqrt {2} \sqrt {\frac {c f^2-b f g+a g^2}{-2 c f+b g+\sqrt {\left (b^2-4 a c\right ) g^2}}}}{\sqrt {f+g x}}\right ),-\frac {-2 c f+b g+\sqrt {\left (b^2-4 a c\right ) g^2}}{2 c f-b g+\sqrt {\left (b^2-4 a c\right ) g^2}}\right )}{g \sqrt {\frac {c f^2+g (-b f+a g)}{-2 c f+b g+\sqrt {\left (b^2-4 a c\right ) g^2}}} \sqrt {a+x (b+c x)}} \]

[In]

Integrate[1/(Sqrt[f + g*x]*Sqrt[a + b*x + c*x^2]),x]

[Out]

(I*(f + g*x)*Sqrt[2 - (4*(c*f^2 + g*(-(b*f) + a*g)))/((2*c*f - b*g + Sqrt[(b^2 - 4*a*c)*g^2])*(f + g*x))]*Sqrt
[1 + (2*(c*f^2 + g*(-(b*f) + a*g)))/((-2*c*f + b*g + Sqrt[(b^2 - 4*a*c)*g^2])*(f + g*x))]*EllipticF[I*ArcSinh[
(Sqrt[2]*Sqrt[(c*f^2 - b*f*g + a*g^2)/(-2*c*f + b*g + Sqrt[(b^2 - 4*a*c)*g^2])])/Sqrt[f + g*x]], -((-2*c*f + b
*g + Sqrt[(b^2 - 4*a*c)*g^2])/(2*c*f - b*g + Sqrt[(b^2 - 4*a*c)*g^2]))])/(g*Sqrt[(c*f^2 + g*(-(b*f) + a*g))/(-
2*c*f + b*g + Sqrt[(b^2 - 4*a*c)*g^2])]*Sqrt[a + x*(b + c*x)])

Maple [A] (verified)

Time = 1.66 (sec) , antiderivative size = 287, normalized size of antiderivative = 1.52

method result size
default \(\frac {\left (-g \sqrt {-4 a c +b^{2}}-b g +2 c f \right ) F\left (\sqrt {2}\, \sqrt {-\frac {\left (g x +f \right ) c}{g \sqrt {-4 a c +b^{2}}+b g -2 c f}}, \sqrt {-\frac {g \sqrt {-4 a c +b^{2}}+b g -2 c f}{2 c f -b g +g \sqrt {-4 a c +b^{2}}}}\right ) \sqrt {\frac {\left (b +2 c x +\sqrt {-4 a c +b^{2}}\right ) g}{g \sqrt {-4 a c +b^{2}}+b g -2 c f}}\, \sqrt {\frac {\left (-b -2 c x +\sqrt {-4 a c +b^{2}}\right ) g}{2 c f -b g +g \sqrt {-4 a c +b^{2}}}}\, \sqrt {2}\, \sqrt {-\frac {\left (g x +f \right ) c}{g \sqrt {-4 a c +b^{2}}+b g -2 c f}}\, \sqrt {c \,x^{2}+b x +a}\, \sqrt {g x +f}}{c g \left (c g \,x^{3}+b g \,x^{2}+c f \,x^{2}+a g x +b f x +f a \right )}\) \(287\)
elliptic \(\frac {2 \sqrt {\left (g x +f \right ) \left (c \,x^{2}+b x +a \right )}\, \left (\frac {f}{g}-\frac {b +\sqrt {-4 a c +b^{2}}}{2 c}\right ) \sqrt {\frac {x +\frac {f}{g}}{\frac {f}{g}-\frac {b +\sqrt {-4 a c +b^{2}}}{2 c}}}\, \sqrt {\frac {x -\frac {-b +\sqrt {-4 a c +b^{2}}}{2 c}}{-\frac {f}{g}-\frac {-b +\sqrt {-4 a c +b^{2}}}{2 c}}}\, \sqrt {\frac {x +\frac {b +\sqrt {-4 a c +b^{2}}}{2 c}}{-\frac {f}{g}+\frac {b +\sqrt {-4 a c +b^{2}}}{2 c}}}\, F\left (\sqrt {\frac {x +\frac {f}{g}}{\frac {f}{g}-\frac {b +\sqrt {-4 a c +b^{2}}}{2 c}}}, \sqrt {\frac {-\frac {f}{g}+\frac {b +\sqrt {-4 a c +b^{2}}}{2 c}}{-\frac {f}{g}-\frac {-b +\sqrt {-4 a c +b^{2}}}{2 c}}}\right )}{\sqrt {g x +f}\, \sqrt {c \,x^{2}+b x +a}\, \sqrt {c g \,x^{3}+b g \,x^{2}+c f \,x^{2}+a g x +b f x +f a}}\) \(321\)

[In]

int(1/(g*x+f)^(1/2)/(c*x^2+b*x+a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

(-g*(-4*a*c+b^2)^(1/2)-b*g+2*c*f)/c*EllipticF(2^(1/2)*(-(g*x+f)*c/(g*(-4*a*c+b^2)^(1/2)+b*g-2*c*f))^(1/2),(-(g
*(-4*a*c+b^2)^(1/2)+b*g-2*c*f)/(2*c*f-b*g+g*(-4*a*c+b^2)^(1/2)))^(1/2))*((b+2*c*x+(-4*a*c+b^2)^(1/2))*g/(g*(-4
*a*c+b^2)^(1/2)+b*g-2*c*f))^(1/2)*((-b-2*c*x+(-4*a*c+b^2)^(1/2))*g/(2*c*f-b*g+g*(-4*a*c+b^2)^(1/2)))^(1/2)*2^(
1/2)*(-(g*x+f)*c/(g*(-4*a*c+b^2)^(1/2)+b*g-2*c*f))^(1/2)/g*(c*x^2+b*x+a)^(1/2)*(g*x+f)^(1/2)/(c*g*x^3+b*g*x^2+
c*f*x^2+a*g*x+b*f*x+a*f)

Fricas [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.09 (sec) , antiderivative size = 128, normalized size of antiderivative = 0.68 \[ \int \frac {1}{\sqrt {f+g x} \sqrt {a+b x+c x^2}} \, dx=\frac {2 \, \sqrt {c g} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (c^{2} f^{2} - b c f g + {\left (b^{2} - 3 \, a c\right )} g^{2}\right )}}{3 \, c^{2} g^{2}}, -\frac {4 \, {\left (2 \, c^{3} f^{3} - 3 \, b c^{2} f^{2} g - 3 \, {\left (b^{2} c - 6 \, a c^{2}\right )} f g^{2} + {\left (2 \, b^{3} - 9 \, a b c\right )} g^{3}\right )}}{27 \, c^{3} g^{3}}, \frac {3 \, c g x + c f + b g}{3 \, c g}\right )}{c g} \]

[In]

integrate(1/(g*x+f)^(1/2)/(c*x^2+b*x+a)^(1/2),x, algorithm="fricas")

[Out]

2*sqrt(c*g)*weierstrassPInverse(4/3*(c^2*f^2 - b*c*f*g + (b^2 - 3*a*c)*g^2)/(c^2*g^2), -4/27*(2*c^3*f^3 - 3*b*
c^2*f^2*g - 3*(b^2*c - 6*a*c^2)*f*g^2 + (2*b^3 - 9*a*b*c)*g^3)/(c^3*g^3), 1/3*(3*c*g*x + c*f + b*g)/(c*g))/(c*
g)

Sympy [F]

\[ \int \frac {1}{\sqrt {f+g x} \sqrt {a+b x+c x^2}} \, dx=\int \frac {1}{\sqrt {f + g x} \sqrt {a + b x + c x^{2}}}\, dx \]

[In]

integrate(1/(g*x+f)**(1/2)/(c*x**2+b*x+a)**(1/2),x)

[Out]

Integral(1/(sqrt(f + g*x)*sqrt(a + b*x + c*x**2)), x)

Maxima [F]

\[ \int \frac {1}{\sqrt {f+g x} \sqrt {a+b x+c x^2}} \, dx=\int { \frac {1}{\sqrt {c x^{2} + b x + a} \sqrt {g x + f}} \,d x } \]

[In]

integrate(1/(g*x+f)^(1/2)/(c*x^2+b*x+a)^(1/2),x, algorithm="maxima")

[Out]

integrate(1/(sqrt(c*x^2 + b*x + a)*sqrt(g*x + f)), x)

Giac [F]

\[ \int \frac {1}{\sqrt {f+g x} \sqrt {a+b x+c x^2}} \, dx=\int { \frac {1}{\sqrt {c x^{2} + b x + a} \sqrt {g x + f}} \,d x } \]

[In]

integrate(1/(g*x+f)^(1/2)/(c*x^2+b*x+a)^(1/2),x, algorithm="giac")

[Out]

integrate(1/(sqrt(c*x^2 + b*x + a)*sqrt(g*x + f)), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {1}{\sqrt {f+g x} \sqrt {a+b x+c x^2}} \, dx=\int \frac {1}{\sqrt {f+g\,x}\,\sqrt {c\,x^2+b\,x+a}} \,d x \]

[In]

int(1/((f + g*x)^(1/2)*(a + b*x + c*x^2)^(1/2)),x)

[Out]

int(1/((f + g*x)^(1/2)*(a + b*x + c*x^2)^(1/2)), x)